#include <jni.h>
#include <string>
#include "util/log.h"
#include "data/axedata_jni.h"

JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
    JNIEnv *env = nullptr;
    jint result = -1;

    LOGI("enter JNI_ONLOAD");

    // 获取JNI env变量
    if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK) {
        // 失败返回-1
        return result;
    }

    if (!loadAxeDataJNI(vm, env)) {
        LOGI("loadAxeDataJNI failed");
        return result;
    }

    // 返回成功
    result = JNI_VERSION_1_6;
    LOGI("jniStudy JNI_OnLoad success");

    return result;
}